const express = require('express')

const router = express.Router()

const studyDataHandler = require('../../router_handler/admin/studyData')

// const verifyToken = (req, res, next) => {
//     const bearerHeader = req.headers.authorization
//     if (typeof bearerHeader !== 'undefined') {
//         req.token = bearerHeader.split(' ')[1]
//         next()
//     } else {
//         res.send({
//             code: 401,
//             msg: '请先登录！',
//             data: {}
//         })
//     }
//     next()
// }



//增加学习资料
router.post('/admin/studyData', studyDataHandler.addStudyData)

//更新学习资料
router.put('/admin/studyData', studyDataHandler.updateStudyData)

//删除学习资料
router.delete('/admin/studyData', studyDataHandler.delStudyData)

//获取学习资料列表
router.get('/admin/studyData', studyDataHandler.getStudyDataList)


module.exports = router